﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using ShoppingOnline.Model;
using Microsoft.EntityFrameworkCore;
using ShoppingOnline.Service;

// For more information on enabling Web API for empty projects, visit http://go.microsoft.com/fwlink/?LinkID=397860

namespace ShoppingOnline.Controllers
{
    //[Route("api/[controller]")]
    public class AccountController : ControllerBase<Users>
    {
        public AccountController(ServiceDbcontext service) : base(service)
        {

        }
        //protected override Users ChangeModel(Users oldmodel, Users model)
        //{
        //    //model.Address = oldmodel.Address;
        //    //model.BrithDay = oldmodel.BrithDay;
        //    //model.Age = oldmodel.Age;
        //    //model.Email = model.Email;
        //    //model.Flag = model.Flag;
        //    //model.UserRole = oldmodel.UserRole;
        //    //model.Userstate = oldmodel.Userstate;
        //    model.LoginId = oldmodel.LoginId;
        //    //model.Name = oldmodel.Name;
        //    model.PassWord= oldmodel.PassWord;
        //    //model.Phone = model.Phone;
        //    //model.Sex = model.Sex;


        //}


        protected override Users ChangeModel(Users oldmodel, Users model)
        {
            model.Flag = model.Flag;
            model.LoginId = oldmodel.LoginId;
            model.PassWord = oldmodel.PassWord;
            return base.ChangeModel(oldmodel, model);
        }

        //// GET: api/values
        //[HttpGet]
        //public IEnumerable<string> Get()
        //{
        //    return new string[] { "value1", "value2" };
        //}

        //// GET api/values/5
        //[HttpGet("{id}")]
        //public string Get(int id)
        //{
        //    return "value";
        //}

        //// POST api/values
        //[HttpPost]
        //public void Post([FromBody]string value)
        //{
        //}

        //// PUT api/values/5
        //[HttpPut("{id}")]
        //public void Put(int id, [FromBody]string value)
        //{
        //}

        //// DELETE api/values/5
        //[HttpDelete("{id}")]
        //public void Delete(int id)
        //{
        //}
    }
}
